package cn.ly.jvm.loader;

public class TestLoader{
	static{
		System.out.println("load me is ==>" + 
					TestLoader.class.getClassLoader().getClass().getName());
	}
	
	
	
	public void finalize(){
		System.out.println("垃圾回收了");
	}
	
	public static void main(String[] args) throws Exception, IllegalAccessException {
		
		System.out.println("Thread id : " + Thread.currentThread().getId());
		Thread.sleep(600 * 1000);
		

		String path = "E:\\newtest\\workspace\\JavaTest\\bin\\";
		MyClassLoader myLoader = new MyClassLoader(path);
		System.out.println("parent=="+myLoader.getParent());
		System.out.println(myLoader.getClass().getClassLoader().getClass().getName());
		//System.out.println(TestLoader.class);
		//Class myTestLoader1 = Class.forName("cn.ly.jvm.loader.TestLoader");
		Class myTestLoader = myLoader.loadClass2("cn.ly.jvm.loader.TestLoader");
		//TestLoader testLoaderObj1 = (TestLoader)myTestLoader1.newInstance();
		//TestLoader testLoaderObj = (cn.ly.jvm.loader.TestLoader)myTestLoader.newInstance();
	}
}
